﻿using System;
using Iesi.Collections.Generic;

namespace DflyingForum.Core.Data.Domain.Entities
{
    /// <summary>
    /// 论坛版块
    /// </summary>
    public class Module : EntityBase
    {
        private ISet<Posts> _posts;

        public virtual int PID { get; set; }

        /// <summary>
        /// 版块递归深度
        /// </summary>
        public virtual int Depth { get; set; }

        /// <summary>
        /// 帖子总量
        /// </summary>
        public virtual int PostCount { get; set; }

        /// <summary>
        /// 回复总量
        /// </summary>
        public virtual int ReplyCount { get; set; }

        /// <summary>
        /// 最后回复的帖子ID
        /// </summary>
        public virtual int LastReplyPostID { get; set; }

        public virtual string Name { get; set; }

        public virtual ISet<Posts> Posts
        {
            get
            {
                return _posts;
            }
            set
            {
                _posts = value;
            }
        }

        /// <summary>
        /// 版块介绍
        /// </summary>
        public virtual string Introduction { get; set; }

        /// <summary>
        /// 版规
        /// </summary>
        public virtual string Rules { get; set; }

        public virtual int CreateUserID { get; set; }

        public virtual bool Enabled { get; set; }

        public virtual int Sort { get; set; }

        public Module()
        {
            this._posts = new HashedSet<Posts>();
        }
    }
}
